import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/purchase',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/PurchaseRequest.vue'),
                    meta: { title: '采购申请' }
                },
                {
                    path: '/user',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/User.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/role',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/Role.vue'),
                    meta: { title: '角色管理' }
                },
            ]
        },
        // {
        //     path: '/login',
        //     component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
        //     meta: { title: '登录' }
        // }
    ]
});
